
		Imports Acceso_a_Datos.Datos
		Namespace BO
		Partial Public Class tCarnet
# Region "tCarnet_x_Persona"
	private mlistatCarnet_x_Persona As New List (Of tCarnet_x_Persona)
Public Property ListatCarnet_x_Persona As System.Collections.Generic.List(Of tCarnet_x_Persona)
Get
dim mtCarnet_x_Persona As New tCarnet_x_Persona
mlistatCarnet_x_Persona =mtCarnet_x_Persona.TraerFiltradoListOf("IdCarnet",Me.IdCarnet)
Return mlistatCarnet_x_Persona
End Get
Set
RemoveAllListatCarnet_x_Persona()
If Not (Value Is Nothing) Then
Dim otCarnet_x_Persona As tCarnet_x_Persona
	For Each otCarnet_x_Persona in Value
		AddListatCarnet_x_Persona(otCarnet_x_Persona)
	Next
End If
End Set
End Property


		
		
	   Public Sub AddListatCarnet_x_Persona(newtCarnet_x_Persona As tCarnet_x_Persona)
	If (mlistatCarnet_x_Persona Is Nothing) Then
		mlistatCarnet_x_Persona = new System.Collections.Generic.List(Of tCarnet_x_Persona)
	End If
	If Not mlistatCarnet_x_Persona.Contains(newtCarnet_x_Persona) Then
		mlistatCarnet_x_Persona.Add(newtCarnet_x_Persona)
		newtCarnet_x_Persona.tCarnet = Me
	End If
End Sub

	   
	   
	   
	   Public Sub RemoveListatCarnet_x_Persona(oldtCarnet_x_Persona As tCarnet_x_Persona)
	If (mlistatCarnet_x_Persona.Contains(oldtCarnet_x_Persona)) Then
		mlistatCarnet_x_Persona.Remove(oldtCarnet_x_Persona)
		oldtCarnet_x_Persona.tCarnet = Nothing
	End If
End Sub
	
			
			Public Sub RemoveAllListatCarnet_x_Persona()
	If Not (mlistatCarnet_x_Persona Is Nothing)
		Dim tmp_listatCarnet_x_Persona As System.Collections.ArrayList = new System.Collections.ArrayList()
		Dim oldtCarnet_x_Persona As tCarnet_x_Persona
		For Each oldtCarnet_x_Persona in mlistatCarnet_x_Persona
			tmp_listatCarnet_x_Persona.Add(oldtCarnet_x_Persona)
		Next
	mlistatCarnet_x_Persona.Clear()
	For Each oldtCarnet_x_Persona in tmp_listatCarnet_x_Persona
		oldtCarnet_x_Persona = Nothing
	Next
	tmp_listatCarnet_x_Persona.Clear()
	End If
End Sub

# End Region


# Region "Lecturas que devuelven listas"
Public Function TraerTodosListOf() As List(Of tCarnet)
            Dim dtDatos As DataTable
            Dim listatCarnet As New List(Of tCarnet)
            Dim param As [String]
            param = (Me.mNombreEntidad + "_SelectAll")
            dtDatos = Me.ServidorDatos.TraerDataTable(param)
            For Each dr As DataRow In dtDatos.Rows
            Dim mtCarnet As New tCarnet
				mtCarnet.IdCarnet = CType(dr.Item("IdCarnet"),Integer)
				mtCarnet.Traer_objeto()
            	listatCarnet.Add( mtCarnet)
    		Next dr
Return listatCarnet
End Function

Public Function TraerFiltradoListOf(ByVal Filtro As [String], ByVal Args As Object) As List(Of tCarnet)
            Dim dtDatos As DataTable
            Dim param As [String]
            Dim listatCarnet As New List(Of tCarnet)
            param = (Me.mNombreEntidad + "_Tx")
            param = (param + Filtro.ToString)
            dtDatos = Me.ServidorDatos.TraerDataTable(param, Args)
            For Each dr As DataRow In dtDatos.Rows
            Dim mtCarnet As New tCarnet
				mtCarnet.IdCarnet = CType(dr.Item("IdCarnet"),Integer)
				mtCarnet.Traer_objeto()
            	listatCarnet.Add( mtCarnet)
    		Next dr
Return listatCarnet
End Function

Public Function TraerFiltradoLikeListOf(ByVal Filtro As [String], ByVal Args As Object) As List(Of tCarnet)
            Dim dtDatos As DataTable
            Dim param As [String]
            Dim listatCarnet As New List(Of tCarnet)
            param = (Me.mNombreEntidad + "_TxLike")
            param = (param + Filtro.ToString)
            dtDatos = Me.ServidorDatos.TraerDataTable(param, Args)
            For Each dr As DataRow In dtDatos.Rows
            Dim mtCarnet As New tCarnet
				mtCarnet.IdCarnet = CType(dr.Item("IdCarnet"),Integer)
				mtCarnet.Traer_objeto()
            	listatCarnet.Add( mtCarnet)
    		Next dr
Return listatCarnet
End Function
# End Region

End Class
End Namespace
